﻿
@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>
<!DOCTYPE html>
<html lang="en">
<head>
    <title>登录</title>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link href="/Content/css/login.css" rel="stylesheet" />
    <link href="/Content/css/themes/default/easyui.css" rel="stylesheet" />
    <link href="/Content/css/themes/icon.css" rel="stylesheet" />
    <link href="/Content/css/themes/color.css" rel="stylesheet" />
    <link href="/Content/css/demo.css" rel="stylesheet" />
    <script src="/Content/script/jquery.min.js"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script  src="@Url.Content("~/Scripts/jquery-1.9.1.min.js")" type="text/javascript">
        $(document).ready(function () {
            $("#LoginIn").click(function () {
                var loginName = $("#userLogin").val();
                var LoginPwd = $("#userPwd").val();
                if (loginName == '')
                {
                    alert("请输入用户名！");
                    return;
                }
                if (LoginPwd == '') {
                    alert("请输入密码！");
                    return;
                }
                $.ajax({
                    url: '/Land/Index',
                    type: 'POST', //GET
                    data: {
                        AdminName: loginName,
                        AdminPassw: LoginPwd
                    },
                    timeout: 5000,    //超时时间
                    dataType: 'json',    //返回的数据格式：json/xml/html/script/jsonp/text

                    success: function (data) {

                        if(data.stauts==0)
                        {
                            alert(data.Meg);
                            window.location.href = "http://www.runoob.com";
                        }else
                        {

                            window.location.href = "http://www.runoob.com";
                        }
                    },
                    error: function (xhr, textStatus) {
                        console.log('错误')
                        console.log(xhr)
                        console.log(textStatus)
                    }

                })


            });
        });


    </script>
</head>
<body>
    <div class="login-bg"></div>
    <div id="loginbox">
        <form id="loginform" class="form-vertical" action="index.html" />
        <div id="logo">
            <img src="/Content/images/logo_nw.png" alt="" />
        </div>
        <p style="color: #FFFFFF;">欢迎使用书城统计表</p>
        <div class="control-group">
            <div class="controls">
                <div class="input-prepend">
                    <span class="login-us-span"></span><input type="text" placeholder="Username" class="login-us-input" id="userLogin" />
                </div>
            </div>
        </div>
        <div class="control-group">
            <div class="controls">
                <div class="input-prepend">
                    <span class="login-pw-span"></span><input type="password" placeholder="Password" class="login-pw-input" id="userPwd" />
                </div>
            </div>
        </div>
        <!--<div class="form-actions">
            <span class="pull-right login-span"><a href="#" class="flip-link" id="to-recover">忘记密码?</a></span>
        </div>-->
        <div class="form-actions">
            <span class="pull-right"><input type="button" id="LoginIn" class="easyui-linkbutton c6  l-btn bgcolor" style="width:215px;height:30px;" value="登录" /></span>
        </div>
        </form>
    </div>
</body>
</html>

